# -*- coding: utf-8 -*-

'''eof
name:申请企业登记状态异常
code:EG_CompanyStatus
tableName:
columnName:
groups:准入>企业业务信息校验
dependencies:EG_CASE_DSJ
type:常用指标
datasourceType:在线指标
description:
eof'''


import sys

reload(sys)
sys.setdefaultencoding('utf-8')


def Ent_RegStatus_Abnormal():
    null_type_list = ['', None, 'null', 'Null', 'NULL', '/']
    con = [u'正常', u'存续']

    try:
        jbxx = EG['srcData'][0]['EG']['results'][0]['jbxx']
        if jbxx.get('company_enterprise_status') not in null_type_list:
            if jbxx['company_enterprise_status'] in con:
                return 1
            else:
                return 0
        else:
            return u'缺失值'
    except:
        return u'缺失值'

result = Ent_RegStatus_Abnormal()